package com.s.controller;

import com.s.service.ZxsService;
import com.s.vo.Test;
import com.zxs.annotation.DingTalkBack;
import com.zxs.annotation.DingTalkFix;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class TestController {

    @Resource
    ZxsService zxsService;

    @GetMapping("/select")
    public String select() throws Exception {
        var message = "";
        String s= zxsService.pushText(message);
        System.out.println(s);
        return s;
    }

    @GetMapping("/select2")   //这种是的固定的消息,里面的内容就是模板的内容无法变动
    @DingTalkFix(mdName = "Markdown类型")
    public String select2() {
        return "";
    }

    @GetMapping("/select3")
    @DingTalkBack(mdName = "FeedCard类型")  //这种是动态消息,里面内容根据你返回类型里面的注解而定
    public Test select3() {
        var test = new Test();
        test.setName("zxs");
        test.setAddr("beijing");
        test.setAction("http://www.baidu.com/");
        return test;
    }
}
